package com.lovo;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class menu extends JPanel implements ActionListener {
    private Icon save =Util.getIcon("/img/buttonSave.jpg");
    private Icon get =Util.getIcon("/img/buttonGet.jpg");
    private Icon find =Util.getIcon("/img/buttonFind.jpg");
    private Icon modify =Util.getIcon("/img/buttonModify.jpg");
    private Icon yes =Util.getIcon("/img/buttonSure.jpg");
    private Icon out =Util.getIcon("/img/buttonOff.jpg");
    private Test0 frame;
    private  JButton jButton5;

         public menu(Test0 frame){
             this.frame=frame;
             this.setLayout(null);
             //存
             JButton jButton =new JButton(save);
             jButton.setBounds(124,468,140,50);
             this.add(jButton);
             //取
             JButton jButton1 =new JButton(get);
             jButton1.setBounds(284,468,140,50);
             this.add(jButton1);
             //查
             JButton jButton2 =new JButton(find);
             jButton2.setBounds(444,468,140,50);
             this.add(jButton2);
             //改
             JButton jButton3 =new JButton(modify);
             jButton3.setBounds(604,468,140,50);
             this.add(jButton3);
             //确认
             JButton jButton4 =new JButton(yes);
             jButton4.setBounds(284,568,140,50);
             this.add(jButton4);
             //退
              jButton5 =new JButton(out);
             jButton5.setBounds(444,568,140,50);
             jButton5.addActionListener(this);
             this.add(jButton5);

             this.setOpaque(false);
         }
    @Override
    public void actionPerformed(ActionEvent e) {
             if (e.getSource()==jButton5){
                 frame.switchPanel("login");
             }

    }
}
